{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}

module Game.Dusk.Tarot.Major where

import Data.Hashable
import Data.Text.Prettyprint.Doc
import GHC.Generics

data MajorArcanum
  = Fool
  | Magician
  | HighPriestess
  | Empress
  | Emperor
  | Hierophant
  | Lovers
  | Chariot
  | Strength
  | Hermit
  | WheelOfFortune
  | Justice
  | HangedMan
  | Death
  | Temperance
  | Devil
  | Tower
  | Star
  | Moon
  | Sun
  | Judgement
  | World
  deriving (Eq, Enum, Bounded, Generic)

instance Hashable MajorArcanum

instance Pretty MajorArcanum where
  {-# INLINE pretty #-}
  pretty Fool = pretty "The Fool"
  pretty Magician = pretty "The Magician"
  pretty HighPriestess = pretty "The High Priestess"
  pretty Empress = pretty "The Empress"
  pretty Emperor = pretty "The Emperor"
  pretty Hierophant = pretty "The Hierophant"
  pretty Lovers = pretty "The Lovers"
  pretty Chariot = pretty "The Chariot"
  pretty Strength = pretty "Strength"
  pretty Hermit = pretty "The Hermit"
  pretty WheelOfFortune = pretty "The Wheel of Fortune"
  pretty Justice = pretty "Justice"
  pretty HangedMan = pretty "The Hanged Man"
  pretty Death = pretty "Death"
  pretty Temperance = pretty "Temperance"
  pretty Devil = pretty "The Devil"
  pretty Tower = pretty "The Tower"
  pretty Star = pretty "The Star"
  pretty Moon = pretty "The Moon"
  pretty Sun = pretty "The Sun"
  pretty Judgement = pretty "Judgement"
  pretty World = pretty "The World"

newtype GameEffect a =
  GameEffect a

instance Pretty (GameEffect MajorArcanum) where
  {-# INLINE pretty #-}
  pretty (GameEffect x) =
    pretty $
    case x of
      Magician -> "Basic or Advanced Sorcery"
      HighPriestess -> "Basic or Advanced Sorcery used this session"
      Empress -> "Basic or Advanced Universal Power used this session"
      Emperor -> "+1 Willpower"
      Hierophant -> "Advanced Power"
      Lovers -> "+1 Charisma"
      Chariot -> "+1 Agility"
      Strength -> "+1 Strength"
      Hermit -> "+1 Intuition"
      Justice -> "+1 Logic"
      HangedMan -> "+1 to any Physical, Mental, or Social Attribute"
      Death -> "Basic or Advanced Orphic Sorcery"
      Temperance -> "Basic or Advanced Astral Sorcery"
      Devil -> "Basic or Advanced Infernal Sorcery"
      Tower -> "+1 to any Physical, Mental or Social Attribute"
      Star -> "+1 to any Physical, Mental or Social Attribute"
      Moon -> "Basic Power, or Advanced Universal Power"
      Sun -> "Basic or Advanced Universal Power"
      World -> "Basic or Advanced Power"
      _ -> "+1 Edge"
